3.3.4 \(\int \frac {(c+d x)^2}{x^2 (a+b x)} \, dx\)

Optimal. Leaf size=51 \[ -\frac {c \log (x) (b c-2 a d)}{a^2}+\frac {(b c-a d)^2 \log (a+b x)}{a^2 b}-\frac {c^2}{a x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {88} \begin {gather*} -\frac {c \log (x) (b c-2 a d)}{a^2}+\frac {(b c-a d)^2 \log (a+b x)}{a^2 b}-\frac {c^2}{a x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2/(x^2*(a + b*x)),x]

[Out]

-(c^2/(a*x)) - (c*(b*c - 2*a*d)*Log[x])/a^2 + ((b*c - a*d)^2*Log[a + b*x])/(a^2*b)

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin {align*} \int \frac {(c+d x)^2}{x^2 (a+b x)} \, dx &=\int \left (\frac {c^2}{a x^2}+\frac {c (-b c+2 a d)}{a^2 x}+\frac {(-b c+a d)^2}{a^2 (a+b x)}\right ) \, dx\\ &=-\frac {c^2}{a x}-\frac {c (b c-2 a d) \log (x)}{a^2}+\frac {(b c-a d)^2 \log (a+b x)}{a^2 b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 51, normalized size = 1.00 \begin {gather*} \frac {-a b c^2+b c x \log (x) (2 a d-b c)+x (b c-a d)^2 \log (a+b x)}{a^2 b x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^2/(x^2*(a + b*x)),x]

[Out]

(-(a*b*c^2) + b*c*(-(b*c) + 2*a*d)*x*Log[x] + (b*c - a*d)^2*x*Log[a + b*x])/(a^2*b*x)

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(c+d x)^2}{x^2 (a+b x)} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(c + d*x)^2/(x^2*(a + b*x)),x]

[Out]

IntegrateAlgebraic[(c + d*x)^2/(x^2*(a + b*x)), x]

________________________________________________________________________________________

fricas [A]  time = 1.28, size = 66, normalized size = 1.29 \begin {gather*} -\frac {a b c^{2} - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x \log \left (b x + a\right ) + {\left (b^{2} c^{2} - 2 \, a b c d\right )} x \log \relax (x)}{a^{2} b x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x^2/(b*x+a),x, algorithm="fricas")

[Out]

-(a*b*c^2 - (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*x*log(b*x + a) + (b^2*c^2 - 2*a*b*c*d)*x*log(x))/(a^2*b*x)

________________________________________________________________________________________

giac [A]  time = 0.90, size = 66, normalized size = 1.29 \begin {gather*} -\frac {c^{2}}{a x} - \frac {{\left (b c^{2} - 2 \, a c d\right )} \log \left ({\left | x \right |}\right )}{a^{2}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | b x + a \right |}\right )}{a^{2} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x^2/(b*x+a),x, algorithm="giac")

[Out]

-c^2/(a*x) - (b*c^2 - 2*a*c*d)*log(abs(x))/a^2 + (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(abs(b*x + a))/(a^2*b)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 73, normalized size = 1.43 \begin {gather*} \frac {2 c d \ln \relax (x )}{a}-\frac {2 c d \ln \left (b x +a \right )}{a}-\frac {b \,c^{2} \ln \relax (x )}{a^{2}}+\frac {b \,c^{2} \ln \left (b x +a \right )}{a^{2}}+\frac {d^{2} \ln \left (b x +a \right )}{b}-\frac {c^{2}}{a x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2/x^2/(b*x+a),x)

[Out]

-c^2/a/x+2*c/a*ln(x)*d-c^2/a^2*ln(x)*b+1/b*ln(b*x+a)*d^2-2/a*ln(b*x+a)*c*d+1/a^2*b*ln(b*x+a)*c^2

________________________________________________________________________________________

maxima [A]  time = 1.12, size = 64, normalized size = 1.25 \begin {gather*} -\frac {c^{2}}{a x} - \frac {{\left (b c^{2} - 2 \, a c d\right )} \log \relax (x)}{a^{2}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (b x + a\right )}{a^{2} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/x^2/(b*x+a),x, algorithm="maxima")

[Out]

-c^2/(a*x) - (b*c^2 - 2*a*c*d)*log(x)/a^2 + (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(b*x + a)/(a^2*b)

________________________________________________________________________________________

mupad [B]  time = 0.41, size = 58, normalized size = 1.14 \begin {gather*} \ln \left (a+b\,x\right )\,\left (\frac {d^2}{b}+\frac {b\,c^2}{a^2}-\frac {2\,c\,d}{a}\right )-\frac {c^2}{a\,x}+\frac {c\,\ln \relax (x)\,\left (2\,a\,d-b\,c\right )}{a^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)^2/(x^2*(a + b*x)),x)

[Out]

log(a + b*x)*(d^2/b + (b*c^2)/a^2 - (2*c*d)/a) - c^2/(a*x) + (c*log(x)*(2*a*d - b*c))/a^2

________________________________________________________________________________________

sympy [B]  time = 0.96, size = 141, normalized size = 2.76 \begin {gather*} - \frac {c^{2}}{a x} + \frac {c \left (2 a d - b c\right ) \log {\left (x + \frac {- 2 a^{2} c d + a b c^{2} + a c \left (2 a d - b c\right )}{a^{2} d^{2} - 4 a b c d + 2 b^{2} c^{2}} \right )}}{a^{2}} + \frac {\left (a d - b c\right )^{2} \log {\left (x + \frac {- 2 a^{2} c d + a b c^{2} + \frac {a \left (a d - b c\right )^{2}}{b}}{a^{2} d^{2} - 4 a b c d + 2 b^{2} c^{2}} \right )}}{a^{2} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2/x**2/(b*x+a),x)

[Out]

-c**2/(a*x) + c*(2*a*d - b*c)*log(x + (-2*a**2*c*d + a*b*c**2 + a*c*(2*a*d - b*c))/(a**2*d**2 - 4*a*b*c*d + 2*
b**2*c**2))/a**2 + (a*d - b*c)**2*log(x + (-2*a**2*c*d + a*b*c**2 + a*(a*d - b*c)**2/b)/(a**2*d**2 - 4*a*b*c*d
 + 2*b**2*c**2))/(a**2*b)

________________________________________________________________________________________